#include "ws2812b_core.h"

void example_4(COLOR *buf, uint16_t buf_len, uint16_t *stept)
{
    uint16_t lstept = *stept;

    for(uint8_t i=0; i<buf_len; i++){
        buf[i].r = 0;
        buf[i].g = 0;
        buf[i].b = 0;
    }

    lstept = (lstept+2) % buf_len;
    buf[lstept].r = 0xFF;
    buf[lstept].g = 0;
    buf[lstept].b = 0;

    lstept = *stept;
    lstept = (lstept+1) % buf_len;
    buf[lstept].r = 0;
    buf[lstept].g = 0xFF;
    buf[lstept].b = 0;

    lstept = *stept % buf_len;
    buf[lstept].r = 0;
    buf[lstept].g = 0;
    buf[lstept].b = 0xFF;


    if(*stept < buf_len){
        (*stept)++;
    }
    else{
        (*stept)=1;
    }
}


